﻿package  {
	import flash.display.MovieClip;
	
	public class Selection extends MovieClip
	{
		var selectionName:String;
		var row:int;
		var column:int;
		
		public function Selection(currentName:String, currentRow:int, currentColumn:int) 
		{
			this.selectionName = currentName;
			this.row = currentRow;
			this.column = currentColumn;
			setPosition();
			setFrame();
		}
		
		// Seta a posição da peça no tabuleiro.
		public function setPosition():void
		{
			this.x = Board.squareSize/2 + (this.column * Board.squareSize);
			this.y = Board.squareSize/2 + (this.row * Board.squareSize);
		}
		
		// Seta o frame do movieclip, cada peça pode ser branca ou preta.
		public function setFrame():void
		{
			gotoAndStop(this.selectionName);
		}

	}
	
}
